<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    //  ++  自增运算符  +1 
    //  --  自减运算符  -1


    var x = 8;
    x++;
    console.log(x)
    ++x;
    console.log(x)

    var y = 10;
    var z = ++y;  //++ 在前 先运算 在赋值
    console.log(z) //11
    var k = z++; //++ 在后  先赋值  在运算
    var y = 1;
    var z = 2;
    var k = y++ + z++  //3
    console.log(k) //11
    console.log(z) //12

    var r = 4;
    var e = 2;
    var o = 12;
    // 5      11   2      5    2     4
    var mn = ++r + --o + e-- + r++ + e++ + --r
    console.log(mn)
    console.log(r)
    console.log(o)
    console.log(e)
    // r   5
    // o   11
    // e   2


  </script>
</body>

</html>